package com.qf.cx.simplenms.persist.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "TagMemory")
public class TagMemoryEntity {
	@Id
	@Column(name = "name")
	private String name;
	@Column
	private int bank;
	// offset 为关键字
	@Column(name = "offset_")
	private int offset;
	@Column
	private int length;

	@ManyToMany(targetEntity = TopicEntity.class, fetch = FetchType.EAGER)
	@JoinTable(name = "Topic_TagMemory", joinColumns = @JoinColumn(name = "tagMemoryName"), inverseJoinColumns = @JoinColumn(name = "topicName"))
	private List<TopicEntity> topicEntities;

	public List<TopicEntity> getTopicEntities() {
		return topicEntities;
	}

	public void setTopicEntities(List<TopicEntity> topicEntities) {
		this.topicEntities = topicEntities;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getBank() {
		return bank;
	}

	public void setBank(int bank) {
		this.bank = bank;
	}

	public int getOffset() {
		return offset;
	}

	public void setOffset(int offset) {
		this.offset = offset;
	}

	public int getLength() {
		return length;
	}

	public void setLength(int length) {
		this.length = length;
	}

}
